import pickle

h_00 = pickle.load(open("../train_history_unet_comb3_mse_00_10lvels.pkl", "rb"))

h_50 = pickle.load(open("../train_history_unet_comb3_mse_50_10lvels.pkl", "rb"))
h_10 = pickle.load(open("../train_history_unet_comb3_mse_10_10lvels.pkl", "rb"))
h_20 = pickle.load(open("../train_history_unet_comb3_mse_20_10lvels.pkl", "rb"))
h_40 = pickle.load(open("../train_history_unet_comb3_mse_40_10lvels.pkl", "rb"))
h_80 = pickle.load(open("../train_history_unet_comb3_mse_80_10lvels.pkl", "rb"))

h_05 = pickle.load(open("../train_history_unet_comb3_mse_05_10lvels.pkl", "rb"))
h_01 = pickle.load(open("../train_history_unet_comb3_mse_01_10lvels.pkl", "rb"))
h_02 = pickle.load(open("../train_history_unet_comb3_mse_02_10lvels.pkl", "rb"))
h_04 = pickle.load(open("../train_history_unet_comb3_mse_04_10lvels.pkl", "rb"))
h_08 = pickle.load(open("../train_history_unet_comb3_mse_08_10lvels.pkl", "rb"))

h_55 = pickle.load(open("../train_history_unet_comb3_mse_55_10lvels.pkl", "rb"))
h_11 = pickle.load(open("../train_history_unet_comb3_mse_11_10lvels.pkl", "rb"))
h_22 = pickle.load(open("../train_history_unet_comb3_mse_22_10lvels.pkl", "rb"))
h_44 = pickle.load(open("../train_history_unet_comb3_mse_44_10lvels.pkl", "rb"))
h_88 = pickle.load(open("../train_history_unet_comb3_mse_88_10lvels.pkl", "rb"))

print("Model,MSE,POD,POFD")
print("M00,{:.4f},{:.4f},{:.4f}".format(h_00['val_mse'][-1], 1 - h_00['val_pom'][-1], h_00['val_pofd'][-1]))
print("M50,{:.4f},{:.4f},{:.4f}".format(h_50['val_mse'][-1], 1 - h_50['val_pom'][-1], h_50['val_pofd'][-1]))
print("M10,{:.4f},{:.4f},{:.4f}".format(h_10['val_mse'][-1], 1 - h_10['val_pom'][-1], h_10['val_pofd'][-1]))
print("M20,{:.4f},{:.4f},{:.4f}".format(h_20['val_mse'][-1], 1 - h_20['val_pom'][-1], h_20['val_pofd'][-1]))
print("M40,{:.4f},{:.4f},{:.4f}".format(h_40['val_mse'][-1], 1 - h_40['val_pom'][-1], h_40['val_pofd'][-1]))
print("M80,{:.4f},{:.4f},{:.4f}".format(h_80['val_mse'][-1], 1 - h_80['val_pom'][-1], h_80['val_pofd'][-1]))
print("M05,{:.4f},{:.4f},{:.4f}".format(h_05['val_mse'][-1], 1 - h_05['val_pom'][-1], h_05['val_pofd'][-1]))
print("M01,{:.4f},{:.4f},{:.4f}".format(h_01['val_mse'][-1], 1 - h_01['val_pom'][-1], h_01['val_pofd'][-1]))
print("M02,{:.4f},{:.4f},{:.4f}".format(h_02['val_mse'][-1], 1 - h_02['val_pom'][-1], h_02['val_pofd'][-1]))
print("M04,{:.4f},{:.4f},{:.4f}".format(h_04['val_mse'][-1], 1 - h_04['val_pom'][-1], h_04['val_pofd'][-1]))
print("M08,{:.4f},{:.4f},{:.4f}".format(h_08['val_mse'][-1], 1 - h_08['val_pom'][-1], h_08['val_pofd'][-1]))
print("M00,{:.4f},{:.4f},{:.4f}".format(h_55['val_mse'][-1], 1 - h_55['val_pom'][-1], h_55['val_pofd'][-1]))
print("M11,{:.4f},{:.4f},{:.4f}".format(h_11['val_mse'][-1], 1 - h_11['val_pom'][-1], h_11['val_pofd'][-1]))
print("M22,{:.4f},{:.4f},{:.4f}".format(h_22['val_mse'][-1], 1 - h_22['val_pom'][-1], h_22['val_pofd'][-1]))
print("M44,{:.4f},{:.4f},{:.4f}".format(h_44['val_mse'][-1], 1 - h_44['val_pom'][-1], h_44['val_pofd'][-1]))
print("M88,{:.4f},{:.4f},{:.4f}".format(h_88['val_mse'][-1], 1 - h_88['val_pom'][-1], h_88['val_pofd'][-1]))

exit()
print()

print("----------------POD Opt-----------------------")
print("------------------MSE-------------------------")
print(['%.4f' % elem for elem in h_00['val_mse'][-1]])
print(['%.4f' % elem for elem in h_50['val_mse'][-1]])
print(['%.4f' % elem for elem in h_10['val_mse'][-1]])
print(['%.4f' % elem for elem in h_20['val_mse'][-1]])
print(['%.4f' % elem for elem in h_40['val_mse'][-1]])
print(['%.4f' % elem for elem in h_80['val_mse'][-1]])
print()
print("------------------POM------------------------")
print(['%.4f' % elem for elem in h_00['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_50['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_10['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_20['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_40['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_80['val_pom'][-10:]])
print()
print("------------------POFD-----------------------")
print(['%.4f' % elem for elem in h_00['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_50['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_10['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_20['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_40['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_80['val_pofd'][-10:]])
print()
print("----------------POFD Opt----------------------")
print("------------------MSE-------------------------")
print(['%.4f' % elem for elem in h_00['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_05['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_01['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_02['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_04['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_08['val_mse'][-10:]])
print()
print("------------------POM------------------------")
print(['%.4f' % elem for elem in h_00['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_05['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_01['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_02['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_04['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_08['val_pom'][-10:]])
print()
print("------------------POFD-----------------------")
print(['%.4f' % elem for elem in h_00['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_05['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_01['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_02['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_04['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_08['val_pofd'][-10:]])
print()
print("----------------POFD Opt----------------------")
print("------------------MSE-------------------------")
print(['%.4f' % elem for elem in h_00['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_05['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_01['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_02['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_04['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_08['val_mse'][-10:]])
print()
print("------------------POM------------------------")
print(['%.4f' % elem for elem in h_00['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_05['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_01['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_02['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_04['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_08['val_pom'][-10:]])
print()
print("------------------POFD-----------------------")
print(['%.4f' % elem for elem in h_00['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_05['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_01['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_02['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_04['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_08['val_pofd'][-10:]])
print()
print("----------------Comb Opt---------------------")
print("------------------MSE-------------------------")
print(['%.4f' % elem for elem in h_00['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_55['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_11['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_22['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_44['val_mse'][-10:]])
print(['%.4f' % elem for elem in h_88['val_mse'][-10:]])
print()
print("------------------POM------------------------")
print(['%.4f' % elem for elem in h_00['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_55['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_11['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_22['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_44['val_pom'][-10:]])
print(['%.4f' % elem for elem in h_88['val_pom'][-10:]])
print()
print("------------------POFD-----------------------")
print(['%.4f' % elem for elem in h_00['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_55['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_11['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_22['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_44['val_pofd'][-10:]])
print(['%.4f' % elem for elem in h_88['val_pofd'][-10:]])
